#!/bin/bash
apt reinstall perl
apt-get update
tightvncserver dbus-x11 xfe -y
apt-get clean
mkdir ~/.vnc
wget https://gitee.com/scicat-team/UOS-termux-noroot/raw/master/xstartup --no-check-certificate -P ~/.vnc/
wget https://gitee.com/lic-miao/ubuntu-arm64/raw/master/desktop/vncserver-start --no-check-certificate -P /usr/local/bin/
wget https://gitee.com/lic-miao/ubuntu-arm64/raw/master/desktop/vncserver-stop --no-check-certificate -P /usr/local/bin/
wget https://gitee.com/lic-miao/ubuntu-arm64/raw/master/desktop/vnc --no-check-certificate -P /usr/local/bin/

chmod +x ~/.vnc/xstartup
chmod +x /usr/local/bin/vncserver-start
chmod +x /usr/local/bin/vncserver-stop
chmod +x /usr/local/bin/vnc
echo " "
echo "如果你想打开 vncserver 请运行命令 vnc"
echo " "
echo "它将要求您在第一次启动时输入密码"
echo " "
echo "VNC Server 启动后将运行在端口 127.0.0.1:5901"
echo " "
echo "您可以使用您喜欢的VNC查看器连接到此地址"
echo " "
echo "连接到端口后将进入Xfce4桌面环境"
echo " "
echo "export DISPLAY=":1"" >> /etc/profile
source /etc/profile
rm ~/desktop.sh
vncserver-start